package cn.wp.ewallet.wmps.service.impl;

import cn.wp.common.core.util.BeanUtil;
import cn.wp.ewallet.wmps.dao.EarnStatLogDao;
import cn.wp.ewallet.wmps.model.dto.EarnStatLogDto;
import cn.wp.ewallet.wmps.service.EarnStatLogService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;


/**
 * 收益统计-业务逻辑层实现
 * Created by zhnagyongli on 2020/01/11
 */
@Service
public class EarnStatLogServiceImpl implements EarnStatLogService {

    @Autowired
    private EarnStatLogDao earnStatLogDao;

    @Override
    public EarnStatLogDto getLatestEarnStatLog(String address) {
        return BeanUtil.copyProperties(earnStatLogDao.selectLatestEarnStatLog(address), EarnStatLogDto.class);
    }

    @Override
    public EarnStatLogDto getEarnStatLogByDate(String address, String date) {
        return BeanUtil.copyProperties(earnStatLogDao.selectEarnStatLogByDate(address, date), EarnStatLogDto.class);
    }
}
